package com.example.springboot_demo.config;

import com.example.springboot_demo.dto.test.Student;
import com.example.springboot_demo.dto.test.Teacher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

/**
 * <P> @Author: SongKeCheng
 * <P> Type: Class
 * <P> Description:
 * <P> Date: 2024/6/22:9:01
 */

@SuppressWarnings({"unchecked", ""})
@Component
public class MyBeanConfig {
    private static final Logger log = LoggerFactory.getLogger(MyBeanConfig.class);

    //@Bean
    public Student student1(){
        return new Student();
    }

    @Bean
    //@Primary
    public Teacher teacher1(){
        Teacher teacher = new Teacher();
        teacher.setName("teacher1");
        return teacher;
    }

    @Bean
    public Teacher teacher2(){
        Teacher teacher = new Teacher();
        teacher.setName("teacher2");
        return teacher;
    }
}
